#pragma once
#include"UIControl.h"
#include"UIFont.h"

BEGIN_NAMESPACE(ui_manager)
BEGIN_NAMESPACE(ui_controls)

class UILabel;
typedef std::shared_ptr<UILabel> UILabelPtr; // Shared pointer to manage dynamic UILabel objects

class UILabel : public UIControl
{
public:
	UILabel(void);
	UILabel(const UILabel& label);
	UILabel& operator= (const UILabel& label);
	~UILabel(void);
	// Setters
	void SetText(std::string text){text_ = text; textChanged_ = true;}
	void SetFont(ui_fonts::UIFont f){font_ = f;}
	// Getters
	std::string GetText(){return text_;}
	ui_fonts::UIFont GetFont(){return font_;}
	void HandleEvent(ui_events::UIEvent ui_event);
	//========== Description ==========
	//PURPOSE : Binds the control a UIManager
	//REQUIRE : UIManager reference to an initialized object and a call to the base class BoundBy
	//PROMISE : Binds the control to the specified manager
	void BoundBy(UIManager& manager, bool is_component);
protected:
	
private:
	std::string text_;
	ui_fonts::UIFont font_;
	bool textChanged_;

	void Render(UIPoint parentPosistion);
	friend class UIManager;
};

END_NAMESPACE // UI controls
END_NAMESPACE // UI manager